/*package util.parser.wikiXML;


import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;

import java.io.File;
import java.io.IOException;

import org.jdom.input.SAXBuilder;
import java.io.IOException;
import java.util.*;

public class WikiParserDom {

	public void isWellFormed(String f) {

		SAXBuilder builder = new SAXBuilder();
		// String file_ = "F:\\data\\gikip\\EN\\en";
		File file = new File(f);
		check(file, builder);
	}

	// command line should offer URIs or file names

	private void check(File file, SAXBuilder builder) {
		if (file.isDirectory()) { // if a directory
			String[] files = file.list(); // list its files
			Arrays.sort(files); // sort the files
			for (int i = 0; i < files.length; i++)
				// recursively index them
				check(new File(file, files[i]), builder);

		} else if (file.getPath().endsWith(".xml")) { // index .txt files

			try {
				builder.build(file);
				// If there are no well-formedness errors,
				// then no exception is thrown
				// System.out.println(file + " is well-formed.");
			}
			// indicates a well-formedness error
			catch (JDOMException e) {
				System.out.println(file + " is not well-formed.");
				System.out.println(e.getMessage());
			} catch (IOException e) {
				System.out.println("Could not check " + file);
				System.out.println(" because " + e.getMessage());
			}

		}
	}

	
	public void parseWiki(String f){
		
		//String file_ = "F:/test/1998_International_Rules_Series_62d1.xml";

		SAXBuilder builder = new SAXBuilder("org.apache.xerces.parsers.SAXParser");
		try {
			org.jdom.Document doc = builder.build(f);
			Element root = doc.getRootElement();
			parser(root, 0);
		}
		// indicates a well-formedness error
		catch (JDOMException e) {
			System.out.println(f + " is not well-formed.");
			System.out.println(e.getMessage());
		} catch (IOException e) {
			System.out.println(e);
		}
		
	}
	
	public static void main(String[] args) {

WikiParserDom wiki = new WikiParserDom();
wiki.parseWiki("F:/test/1998_International_Rules_Series_62d1.xml");

	}

 public static void parser(Object o, int depth) {
		 printSpaces(depth);
		 
		 
		   if (o instanceof Element) {
		      Element element = (Element) o;
		      //System.out.println("Element: " + element.getName());
		      //System.out.println("Element: " + element.getTextNormalize());
		      
		      
		      
		      parseElement(element);
		      
		      List children = element.getContent();
		      Iterator iterator = children.iterator();
		      while (iterator.hasNext()) {
		        Object child = iterator.next();
		        parser(child, depth+1);
		      }
		    }
		    else if (o instanceof Document) {
		      System.out.println("Document");
		      Document doc = (Document) o;
		      List children = doc.getContent();
		      Iterator iterator = children.iterator();
		      while (iterator.hasNext()) {
		        Object child = iterator.next();
		        parser(child, depth+1);
		      }
		    }
		    else if (o instanceof Comment) {
		      System.out.println("Comment");
		    }
		    else if (o instanceof CDATA) {
		      System.out.println("CDATA section");
		      // CDATA is a subclass of Text so this test must come
		      // before the test for Text.
		    }
		    else if (o instanceof Text) {
		   //   System.out.println("Text");
		      Text t = (Text)o;
		   //   System.out.println( "===" +t.getText());
		     
		    }
		    else if (o instanceof EntityRef) {
		      System.out.println("Entity reference");
		    }
		    else if (o instanceof ProcessingInstruction) {
		      System.out.println("Processing Instruction");
		    }
		    else {  // This really shouldn't happen
		      System.out.println("Unexpected type: " + o.getClass());
		    }
		    
		  }
	
	
	 private static void parseElement(Element element) {
	// TODO Auto-generated method stub
	
}

	public static void listNodes(Object o, int depth) {
		   
		    printSpaces(depth);
		    
		    if (o instanceof Element) {
		      Element element = (Element) o;
		      System.out.println("Element: " + element.getName());
		      List children = element.getContent();
		      Iterator iterator = children.iterator();
		      while (iterator.hasNext()) {
		        Object child = iterator.next();
		        listNodes(child, depth+1);
		      }
		    }
		    else if (o instanceof Document) {
		      System.out.println("Document");
		      Document doc = (Document) o;
		      List children = doc.getContent();
		      Iterator iterator = children.iterator();
		      while (iterator.hasNext()) {
		        Object child = iterator.next();
		        listNodes(child, depth+1);
		      }
		    }
		    else if (o instanceof Comment) {
		      System.out.println("Comment");
		    }
		    else if (o instanceof CDATA) {
		      System.out.println("CDATA section");
		      // CDATA is a subclass of Text so this test must come
		      // before the test for Text.
		    }
		    else if (o instanceof Text) {
		      System.out.println("Text");
		    }
		    else if (o instanceof EntityRef) {
		      System.out.println("Entity reference");
		    }
		    else if (o instanceof ProcessingInstruction) {
		      System.out.println("Processing Instruction");
		    }
		    else {  // This really shouldn't happen
		      System.out.println("Unexpected type: " + o.getClass());
		    }
		    
		  }

	private static void printSpaces(int n) {

		for (int i = 0; i < n; i++) {
			System.out.print(' ');
		}

	}

}
*/